﻿
//作用：弹出Iframe
function openIframe(url, title) {
    art.dialog.open(url,
            {
                title: title,
                lock: true,
                opacity: 0.50// 透明度
            }
            );
}
//作用：成功提示
function tips() {
    //成功提示
    art.dialog.tips('操作成功！', 1.5);
}

//作用：确认提示
//callback：回调函数
function confirm(callback) {
    art.dialog.confirm('你确认执行操作？', function () {
        if (callback.constructor == Function) {
            callback();
        }
    }, function () {
        art.dialog.tips('你取消了操作');
    });
}
//作用：成功
//callback：回调函数
function success(callback) {
    //成功调用
    alertJs("操作成功", 1, 0, callback);
}
//作用：失败
//callback：回调函数
function filed(callback) {
    //失败调用
    alertJs("操作失败", 0, 0, callback);
}
//作用：弹出提示
//msg:弹出消息
//hasicon：显示图标，0：失败，1：成功，2:警告，3：疑问，4：笑脸，5：悲剧，默认：成功
//url：指向的地址
function alertJs(msg, hasicon, url) {
    var icons = "succeed";
    switch (hasicon) {
        case 0:
            icons = "error"
            break;
        case 1:
            icons = "succeed"
            break;
        case 2:
            icons = "warning"
            break;
        case 3:
            icons = "question"
            break;
        case 4:
            icons = "face-smile"
            break;
        case 5:
            icons = "face-sad"
            break;
        default:
            icons = "succeed";

    }

    art.dialog({
        icon: icons,
        content: msg,
        lock: true,
        time: 1,
        cancel: function () { location.href = url; },
        opacity: 0.50
    });
}  
 